from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
import time
browser=webdriver.Chrome(executable_path=r"C:\Users\xmxc\Desktop\chrome\App\chromedriver.exe")
browser.get('http://www.12306.cn/index/')
id_word="toStationText"
locator=(By.ID,"toStationText")
wait=WebDriverWait(browser,10).until(EC.presence_of_element_located(locator))
input=browser.find_element_by_id("toStationText")
input.clear()
input.send_keys("北京")
time.sleep(3)
browser.close()